﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TimesheetUserControl.ascx.cs"
    Inherits="ContractManagementSystem.Controls.TimesheetUserControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<div class="divWrap" style="margin-top: 30px;">
    <asp:UpdatePanel runat="server" ID="SearchUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="searchPanel">
                <div id="timesheetSearch">
                    <fieldset style="width: 99%; margin: auto; padding-left: 7px;" class="border">
                        <legend><b>Search</b></legend>
                        <table style="width: 90%; margin: 15px auto 20px auto;">
                            <tbody>
                                <tr>
                                    <td>
                                        Contractor:
                                    </td>
                                    <td>
                                        <asp:Panel runat="server" ID="AdminAction" Style="display: inline;" Visible="false">                                            
                                            <asp:TextBox runat="server" ID="ContractorTextBox" Width="100px" ToolTip="Enter the ACCOUNT NAME of a Contractor"></asp:TextBox>
                                            <asp:Button runat="server" ID="ContractorSelectButton" Text="Check" ToolTip="Check and fill Contract of this Contractor to a combobox"
                                                OnClick="ContractorSelectButton_OnClick" />
                                            <asp:Literal runat="server" ID="CheckContractorLiteral" Visible="false" Text="Do not exist this Contractor!"></asp:Literal>
                                        </asp:Panel>
                                        <asp:DropDownList runat="server" Width="170px" ID="ContractorDropDownList" AutoPostBack="true"
                                            OnSelectedIndexChanged="ContractorDropDownList_OnSelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                        From date:
                                    </td>
                                    <td>
                                        <asp:TextBox Width="70%" ID="FromDateTextBox" runat="server" Enabled="False"></asp:TextBox>
                                        <asp:ImageButton ID="Image" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                                        <cc1:CalendarExtender ID="CalendarExtender" CssClass="cal_Theme1" runat="server"
                                            TargetControlID="FromDateTextBox" PopupButtonID="Image" PopupPosition="Right"
                                            Format="MM/dd/yyyy">
                                        </cc1:CalendarExtender>
                                    </td>
                                    <td>
                                        Status:
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="StatusDropDownList" runat="server">
                                            <asp:ListItem>All</asp:ListItem>
                                            <asp:ListItem>Reject</asp:ListItem>
                                            <asp:ListItem>Pending</asp:ListItem>
                                            <asp:ListItem>Approved</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Contract:
                                    </td>
                                    <td>
                                        <asp:DropDownList runat="server" Width="170px" ID="ContractDropDownList" AutoPostBack="true" OnSelectedIndexChanged="ContractDropDownList_OnSelectedIndexChanged" />
                                    </td>
                                    <td>
                                        To date:
                                    </td>
                                    <td>
                                        <asp:TextBox Width="70%" ID="ToDateTextBox" runat="server" Enabled="False"></asp:TextBox>
                                        <asp:ImageButton ID="ImageButton" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                                        <cc1:CalendarExtender ID="CalendarExtender1" CssClass="cal_Theme1" runat="server"
                                            TargetControlID="ToDateTextBox" PopupButtonID="ImageButton" PopupPosition="Right"
                                            Format="MM/dd/yyyy">
                                        </cc1:CalendarExtender>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div style="margin: 10px auto 10px auto; width: 100%;" align="center">
                            <asp:Button ID="ListTimesheetButton" runat="server" Text="List TimeSheet" OnClick="ListTimesheetButton_OnClick"/>
                            <asp:Button runat="server" ID="AddNewButton" OnClick="AddNewButton_OnClick" Text="Add TimeSheet"
                                ToolTip="Add new timesheet" />
                        </div>
                    </fieldset>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>    
    <asp:UpdatePanel runat="server" ID="TopTimesheetUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="TopPanel" Visible="false">
                <asp:Label runat="server" CssClass="titleLabel" ID="TitleListTimesheetLabel"></asp:Label><br/>
                <asp:Literal runat="server" ID="StatusListTimesheetLabel"></asp:Literal>
                <asp:ListView runat="server" ID="TimesheetListView" ItemPlaceholderID="NewItem" 
                OnItemDataBound="TimesheetListView_OnItemDataBound">
                    <EmptyDataTemplate>
                        <h4 class="empty">There are no item to show in this view.</h4>
                    </EmptyDataTemplate>
                    <LayoutTemplate>
                        <table id="table">
                            <tr>
                                <asp:Panel runat="server" ID="HeaderConsultantPanel">
                                <th style="width: 2%;">
                                    <input type="checkbox" id="SelectAllCheckBox" onclick="javascript:ForHeaderCheckBox(this);" />
                                </th>
                                </asp:Panel>
                                <th style="width: 12%;">
                                    <div style="width: 81%;">
                                        WorkDate</div>
                                </th>
                                <th style="width: 4%;">
                                    <div style="width: 75%;">
                                        Time</div>
                                </th>
                                <th>
                                    <div style="width: 81%;">
                                        Description</div>
                                </th>
                                <th style="width: 12%;">
                                    <div style="width: 81%; float: left;">
                                        Status</div>
                                </th>
                                <asp:Panel runat="server" ID="HeaderActionPanel">
                                    <th style="width: 16%;" colspan="2">
                                        Action
                                    </th>
                                </asp:Panel>
                            </tr>
                            <tr>
                                <asp:PlaceHolder runat="server" ID="NewItem"></asp:PlaceHolder>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr class="odd">
                            <asp:Panel runat="server" ID="ConsultantPanel">
                            <td>
                                <input type="checkbox" runat="server" id="ItemCheckBox" onclick="javascript:ForItemCheckBox(this);" value='<%# DataBinder.Eval(Container.DataItem, "TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>' />
                            </td>
                            </asp:Panel>
                            <td>
                                <asp:Label runat="server" ID="WordDateLabel" Text='<%# DataBinder.Eval(Container.DataItem, "WorkDate","{0:MM/dd/yyyy}")%>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="WorkingTimeLabel" Text='<%# DataBinder.Eval(Container.DataItem, "WorkingTime")%>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="DescriptionLabel" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="StatusLabel" Text='<%# DataBinder.Eval(Container.DataItem, "Status")%>'></asp:Label>
                            </td>
                            <asp:Panel runat="server" ID="ActionPanel" Style="display: inline;">
                                <td>
                                    <div align="center">
                                        <asp:LinkButton runat="server" ToolTip="Edit" ID="EditLinkButton" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>'
                                            CssClass="edit" OnCommand="EditLinkButton_OnCommand" Style="margin-right: 5px;
                                            color: black; font-size: 13px;" />
                                        <asp:LinkButton runat="server" ToolTip="Delete" ID="DeleteLinkButton" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") %>'
                                            CssClass="delete" Style="color: black; font-size: 13px;" OnCommand="DeleteLinkButton_OnCommand"
                                            OnClientClick="return confirm('Are you sure you want to delete?')" />
                                    </div>
                                </td>
                            </asp:Panel>
                            <asp:Panel runat="server" ID="StatusPanel" Style="display: inline;">
                                <td>
                                    <div align="center">
                                        <asp:LinkButton runat="server" ToolTip="Approved" ID="LinkButton3" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>'
                                            CssClass="approved" OnCommand="ApprovedLinkButton_OnCommand" Style="margin-right: 5px;
                                            color: black; font-size: 13px;" />
                                        <asp:LinkButton runat="server" ToolTip="Reject" ID="LinkButton4" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>'
                                            CssClass="reject" OnCommand="RejectLinkButton_OnCommand" Style="color: black;
                                            font-size: 13px;" />
                                    </div>
                                </td>
                            </asp:Panel>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="alt">
                            <asp:Panel runat="server" ID="ConsultantPanel">
                            <td>
                                <input type="checkbox" runat="server" id="ItemCheckBox"  onclick="javascript:ForItemCheckBox(this);" value='<%# DataBinder.Eval(Container.DataItem, "TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>' />
                            </td>
                            </asp:Panel>
                            <td>
                                <asp:Label runat="server" ID="WordDateLabel" Text='<%# DataBinder.Eval(Container.DataItem, "WorkDate","{0:MM/dd/yyyy}")%>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="WorkingTimeLabel" Text='<%# DataBinder.Eval(Container.DataItem, "WorkingTime")%>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="DescriptionLabel" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="StatusLabel" Text='<%# DataBinder.Eval(Container.DataItem, "Status")%>'></asp:Label>
                            </td>
                            <asp:Panel runat="server" ID="ActionPanel" Style="display: inline;">
                                <td>
                                    <div align="center">
                                        <asp:LinkButton runat="server" ToolTip="Edit" ID="EditLinkButton" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>'
                                            CssClass="edit" OnCommand="EditLinkButton_OnCommand" Style="margin-right: 5px;
                                            color: black; font-size: 13px;" />
                                        <asp:LinkButton runat="server" ToolTip="Delete" ID="DeleteLinkButton" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") %>'
                                            CssClass="delete" Style="color: black; font-size: 13px;" OnCommand="DeleteLinkButton_OnCommand"
                                            OnClientClick="return confirm('Are you sure you want to delete?')" />
                                    </div>
                                </td>
                            </asp:Panel>
                            <asp:Panel runat="server" ID="StatusPanel" Style="display: inline;">
                                <td>
                                    <div align="center">
                                        <asp:LinkButton runat="server" ToolTip="Approved" ID="LinkButton3" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>'
                                            CssClass="approved" OnCommand="ApprovedLinkButton_OnCommand" Style="margin-right: 5px;
                                            color: black; font-size: 13px;" />
                                        <asp:LinkButton runat="server" ToolTip="Reject" ID="LinkButton4" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "TimesheetId") +"$"+ DataBinder.Eval(Container.DataItem,"Id")%>'
                                            CssClass="reject" Style="color: black; font-size: 13px;" OnClientClick="return validateRejectLinkButton()"
                                            OnCommand="RejectLinkButton_OnCommand" />
                                    </div>
                                </td>
                            </asp:Panel>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:ListView>
                <div class="divPage">
                    <asp:DataPager runat="server" ID="TimesheetDataPager" PagedControlID="TimesheetListView"
                        PageSize="14" OnPreRender="TimesheetDataPager_OnPreRender">
                        <Fields>
                            <asp:NumericPagerField CurrentPageLabelCssClass="curent" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="ButtonTimesheetUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="ActionTopPanel" Visible="false">
                <div align="center" style="margin: 15px auto 15px auto">
                <asp:Button runat="server" Width="80px" ID="BatchApprovedButton" OnClick="BatchApprovedButton_OnClick"
                    Text="Appvored" ToolTip="Batch Appvored Timesheet" />
                <asp:Button runat="server" Width="80px" ID="BatchRejectTimesheet" OnClick="BatchRejectTimesheet_OnClick"
                    Text="Reject" ToolTip="Batch Reject timesheet" />
                <asp:Button runat="server" Width="80px" ID="BatchUpdateButton" OnClick="BatchUpdateButton_OnClick"
                    Text="Update" ToolTip="Batch Update Timesheet" />
                <asp:Button runat="server"  Width="80px" ID="BatchDeleteButton" Text="Delete" ToolTip="Batch Delete TimeSheet"
                    OnClick="BatchDeleteButton_OnClick" />
            </div></asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="BottomUpdatePanel">        
        <ContentTemplate>
            <asp:Panel runat="server" ID="BottomPanel" Visible="false">
                <asp:Label runat="server" CssClass="titleLabel" ID="TitleUpdateTimesheetLabel"></asp:Label><br/>
                <asp:Literal runat="server" ID="StatusUpdateTimesheetLabel"></asp:Literal>
                <asp:ListView runat="server" ID="EditTimesheetListView" ItemPlaceholderID="NewItem">
                    <LayoutTemplate>
                        <table id="tableEdit">
                            <tr>
                                <th class="th" style="width: 12%;">
                                    Work date
                                </th>
                                <th class="th" style="width: 5%;">
                                    Time
                                </th>
                                <th class="th">
                                    Description
                                </th>
                                <th class="th" style="width: 7%;">
                                    Status
                                </th>
                            </tr>
                            <tr>
                                <asp:PlaceHolder runat="server" ID="NewItem"></asp:PlaceHolder>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr class="odde">
                            <td class="td">
                                <asp:Label runat="server" Width="0px" ID="TimesheetId" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") %>'></asp:Label>
                                <asp:TextBox Width="70%" ID="WorkDateTextBox" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"WorkDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                                <asp:ImageButton ID="Image" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                                <cc1:CalendarExtender ID="CalendarExtender" CssClass="cal_Theme1" runat="server"
                                    TargetControlID="WorkDateTextBox" PopupButtonID="Image" PopupPosition="Right"
                                    Format="MM/dd/yyyy">
                                </cc1:CalendarExtender>
                            </td>
                            <td class="td">
                                <asp:TextBox Width="90%" runat="server" ID="TimeTextBox" Text='<%# DataBinder.Eval(Container.DataItem,"WorkingTime") %>'></asp:TextBox>
                            </td>
                            <td class="td">
                                <asp:TextBox runat="server" Width="85%" ID="DescriptionTextBox" Text='<%# DataBinder.Eval(Container.DataItem,"Description") %>'></asp:TextBox>
                            </td>
                            <td class="td">
                                <%# DataBinder.Eval(Container.DataItem,"Status") %>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="alte">
                            <td class="td">
                                <asp:Label runat="server" Width="0px" ID="TimesheetId" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") %>'></asp:Label>
                                <asp:TextBox Width="70%" ID="WorkDateTextBox" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"WorkDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                                <asp:ImageButton ID="Image" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                                <cc1:CalendarExtender ID="CalendarExtender" CssClass="cal_Theme1" runat="server"
                                    TargetControlID="WorkDateTextBox" PopupButtonID="Image" PopupPosition="Right"
                                    Format="MM/dd/yyyy">
                                </cc1:CalendarExtender>
                            </td>
                            <td class="td">
                                <asp:TextBox Width="90%" runat="server" ID="TimeTextBox" Text='<%# DataBinder.Eval(Container.DataItem,"WorkingTime") %>'></asp:TextBox>
                            </td>
                            <td class="td">
                                <asp:TextBox runat="server" Width="85%" ID="DescriptionTextBox" Text='<%# DataBinder.Eval(Container.DataItem,"Description") %>'></asp:TextBox>
                            </td>
                            <td class="td">
                                <%# DataBinder.Eval(Container.DataItem,"Status") %>
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:ListView>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="ActionBottomUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="ActionBottomPanel" Visible="false">
            <div align="center" style="margin: 15px auto 15px auto">
                <asp:Button runat="server" Width="80px" ID="UpdateButton"   Text="Update" OnClientClick="return isValidate()"
                    OnClick="UpdateButton_OnClick" />
                <asp:Button runat="server" Width="80px" ID="BackButton" OnClick="BackButton_OnClick" Text="Back" />
            </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="RejectUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="RejectPanel" Visible="false">
                <asp:Label runat="server" CssClass="titleLabel" ID="TitleRejectTimesheetLabel"></asp:Label><br/>
                <asp:Literal runat="server" ID="StatusRejectTimesheetLabel"></asp:Literal>
                <asp:ListView runat="server" ID="RejectListView" ItemPlaceholderID="newItem">
                    <LayoutTemplate>
                        <table id="table">
                            <tr>
                                <th>
                                    WorkDate
                                </th>
                                <th>
                                    WorkingTime
                                </th>
                                <th>
                                    Description
                                </th>
                                <th>
                                    Status
                                </th>
                            </tr>
                            <tr>
                                <asp:PlaceHolder runat="server" ID="newItem"></asp:PlaceHolder>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:Label runat="server" ID="TimesheetIdLabel" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") %>'></asp:Label>
                                <asp:Label runat="server" ID="WorkDateLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Workdate","{0:MM/dd/yyyy}") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="WorkingTimeLabel" Text='<%# DataBinder.Eval(Container.DataItem,"WorkingTime") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="DescriptionLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Description") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="StatusLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Status") %>'></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="alt">
                            <td>
                                <asp:Label runat="server" ID="TimesheetIdLabel" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem,"TimesheetId") %>'></asp:Label>
                                <asp:Label runat="server" ID="WorkDateLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Workdate","{0:MM/dd/yyyy}") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="WorkingTimeLabel" Text='<%# DataBinder.Eval(Container.DataItem,"WorkingTime") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="DescriptionLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Description") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="StatusLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Status") %>'></asp:Label>
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:ListView>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="MessageBottomUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="MessageBottomPanel" Visible="false">
                <div id="message">
                    <h4>
                        Reject Message</h4>
                    <asp:TextBox runat="server"  ID="MessageTextBox" TextMode="MultiLine" Height="115px"
                        Width="400px"></asp:TextBox>
                    <asp:Button runat="server"   Width="80px" ID="RejectButton" OnClick="RejectButton_OnClick" Text="Reject" />
                    <asp:Button runat="server"   Width="80px" ID="BackMessageButton" OnClick="BackButton_OnClick" Text="Back" />
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="AddNewUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="AddNewPanel" Visible="false">
                <asp:Label CssClass="titleLabel" runat="server" ID="TitleAddNewTimesheetLabel"></asp:Label><br/>
                <asp:Literal runat="server" ID="StatusAddNewTimesheetLabel"></asp:Literal>
                <asp:ListView runat="server" ID="AddNewListView" ItemPlaceholderID="NewItem">
                    <LayoutTemplate>
                        <table id="tableEdit">
                            <tr>
                                <th class="th" style="width: 13%;">
                                    WorkDate
                                </th>
                                <th class="th" style="width: 6%;">
                                    Time
                                </th>
                                <th class="th">
                                    Description
                                </th>
                            </tr>
                            <tr>
                                <asp:PlaceHolder runat="server" ID="NewItem"></asp:PlaceHolder>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr class="odde">
                            <td class="td">
                                <asp:TextBox runat="server" Width="85px" ID="WorkDateTextBox" Text='<%# DataBinder.Eval(Container.DataItem,"WorkDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                                <asp:ImageButton ID="Image" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                                <cc1:CalendarExtender ID="CalendarExtender" CssClass="cal_Theme1" runat="server"
                                    TargetControlID="WorkDateTextBox" PopupButtonID="Image" PopupPosition="Right"
                                    Format="MM/dd/yyyy">
                                </cc1:CalendarExtender>
                            </td>
                            <td class="td">
                                <asp:TextBox Width="90%" runat="server" ID="TimeTextBox"></asp:TextBox>
                            </td>
                            <td class="td">
                                <asp:TextBox runat="server" Width="85%" ID="DescriptionTextBox"></asp:TextBox>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="alte">
                            <td class="td">
                                <asp:TextBox runat="server" Width="85px" ID="WorkDateTextBox" Text='<%# DataBinder.Eval(Container.DataItem,"WorkDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                                <asp:ImageButton ID="Image" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                                <cc1:CalendarExtender ID="CalendarExtender" CssClass="cal_Theme1" runat="server"
                                    TargetControlID="WorkDateTextBox" PopupButtonID="Image" PopupPosition="Right"
                                    Format="MM/dd/yyyy">
                                </cc1:CalendarExtender>
                            </td>
                            <td class="td">
                                <asp:TextBox Width="90%" runat="server" ID="TimeTextBox"></asp:TextBox>
                            </td>
                            <td class="td">
                                <asp:TextBox runat="server" Width="85%" ID="DescriptionTextBox"></asp:TextBox>
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:ListView>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="ActionAddNewUpdatePanel">
        <ContentTemplate>
            <asp:Panel runat="server" ID="ActionAddNewPanel" Visible="false">
            <div align="center" style="margin: 15px auto 15px auto">
                <asp:Button runat="server"  Width="80px" ID="AddNewTimesheetButton" OnClientClick="return isValidate()"
                    OnClick="AddNewTimesheetButton_OnClick" Text="AddNew" />
                <asp:Button runat="server"  Width="80px" ID="Button" OnClick="BackButton_OnClick" Text="Back" />
            </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <input type="hidden" id="hiddenBox" runat="server" />
    <input type="hidden" id="roleBox" runat="server"/>
    <asp:UpdatePanel runat="server" ID="HiddenUpdatePanel">
        <ContentTemplate>
            <input type="hidden" id="EndDateBox" runat="server"/>
            <input type="hidden" id="StartDateBox" runat="server"/>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
